package com.itheima.test05;

import java.util.Arrays;

/*
Arrays 工具类
 */
public class Test01 {

    public static void main(String[] args) {
        //toString
        int[] arr= {10,8,9,5,7,1,3,4,2};
        System.out.println(Arrays.toString(arr));

        //sort  排序
        Arrays.sort(arr);
        System.out.println(Arrays.toString(arr));

        //binarySearch 二分查找
        int index = Arrays.binarySearch(arr, 6);
        System.out.println(index);
        if(index<0){
            System.out.println("如果你想插入 他应该在:"+-(index + 1));
        }


    }
}
